#include"comm.hpp"

int main()
{
    key_t key=getkey();
    cout<<key<<endl;
    int shmid=creatshm(key);
    cout<<"shmid:"<<shmid<<endl;
    char* start=(char*)attachshm(shmid);
    printf("start:%p\n",start);

    while(true)
    {
        cout<<"client say: "<<start<<" ";
        struct shmid_ds ds;
        shmctl(shmid,IPC_STAT,&ds);
        cout<<ds.shm_segsz<<endl;
        sleep(1);
    }

    dttachshm(start);
    deleteshm(shmid);
    return 0;
}